package com.Pure;

import java.util.Stack;

import javax.microedition.khronos.opengles.GL10;

import android.graphics.Color;
import android.graphics.Typeface;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.e3roid.E3Scene;
import com.e3roid.E3Activity;
import com.e3roid.drawable.Shape;
import com.e3roid.drawable.Sprite;
import com.e3roid.drawable.sprite.TextSprite;
public class PureLevel extends E3Scene {
	
	 private PureGrid grid;
	
	public PureLevel()
	{
		super();
		// insert main game play code here
        //get Factory from main;
        PureGameFactory factory = PureMain.getInstance().factory;       
        //create grid;
		grid = factory.createGrid();
		
		getTopLayer().add(grid);
		
	}
	public PureGrid getGrid(){return grid;}
	//call back from level loader
	public void onLevelLoaded()
	{
		//update and generate lightray reflection
		grid.updateLightRay();
       
	}
	
	public int getVempireCount()
	{
		PureGameObject[][] container = grid.getGameObjectList();
		
		int counter = 0;
		
		for(int i = 0;i< 10;i++)
			for(int j = 0;j<10;j++)
				if(container[i][j] instanceof PureVempire)
					counter++;
		
		return counter;
	}
	
	public boolean onKeyDown(E3Scene scene, int keyCode, KeyEvent event) {
    	
		//insert key handle here, but not useful..
		return false;
	} 
	
	 

}
